<include file="public@header"/>

<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Student/index')}">学生列表</a></li>
        <li class="active"><a href="{:url('Student/add')}">添加学生</a></li>
    </ul>
    <div class="row margin-top-20">
        <div class="col-md-10 col-md-offset-2">
            <form action="{:url('Student/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
                <div class="row">
                    <div class="col-md-9">
                        <table class="table table-bordered chase_classroom_table">
                            <tr>
                                <th>姓名<span class="form-required">*</span></th>
                                <td>
                                    <input type="text"   class="form-control col-md-4" name="name" placeholder="请输入学生姓名" value="">
                                </td>
                            </tr>
                            <tr>
                                <th>性别<span class="form-required">*</span></th>
                                <td>
                                    <div class="col-md-4" style="padding-left: 0px;">
                                        <select class="form-control " name="gender">
                                            <option value='0' selected>保密</option>
                                            <option value='1'>男</option>
                                            <option value='2'>女</option>
                                        </select>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <th>年级</th>
                                <td>
                                    <div class="col-md-4" style="padding-left: 0px;">
                                        <select name="grade" class="form-control" id="">
                                            <option value="1">一年级</option>
                                            <option value="2">二年级</option>
                                            <option value="3">三年级</option>
                                            <option value="4">四年级</option>
                                            <option value="5">五年级</option>
                                            <option value="6">六年级</option>
                                            <option value="7">七年级</option>
                                            <option value="8">八年级</option>
                                            <option value="9">九年级</option>
                                            <option value="10">十一年级</option>
                                            <option value="11">十一年级</option>
                                            <option value="12">十二年级</option>
                                        </select>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>生日</th>
                                <td>
                                    <div class="col-md-4" style="padding-left: 0px;">
                                        <input type="text" class="form-control" name="birthday" placeholder="请输入生日"
                                           value="" autocomplete="off" >
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>所在学校</th>
                                <td>
                                    <input type="text" class="form-control" name="school_name" placeholder="请输入学校名称" value="">
                                </td>
                            </tr>
                            <tr>
                                <th>家长手机号<span class="form-required">*</span></th>
                                <td>
                                    <input type="text" class="form-control" name="mobile" id="show_mobile" placeholder="请输入家长手机号" value="">
                                    <input type="hidden" class="form-control" name="pid" id="hidden_mobile" value="">
                                </td>
                            </tr>
                            <tr>
                                <th>联系地址<span class="form-required">*</span></th>
                                <td>
                                    <input type="text" class="form-control" name="address" placeholder="请输入联系地址" value="">
                                </td>
                            </tr>
                        </table>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
                                <a class="btn btn-default" href="{:url('Student/index')}">{:lang('BACK')}</a>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<!--ajax layer 弹窗-->
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.autocomplete.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $('input[name="birthday"]').datepicker({
          changeMonth: true,
          changeYear: true
        });//日期

        //自动补全
        var url = "{:url('Student/ajaxUser')}";
        $('#show_mobile').devbridgeAutocomplete({
            serviceUrl: url,
            autoSelectFirst: true,
            minChars: 1,
            showNoSuggestionNotice: true,
            onSelect: function (suggestion) {
                //设置ID
                $('#hidden_mobile').val(suggestion.data);
            }
        });

    });

</script>

</body>
